package com.woniu.utils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Formatter;
//密码加密
public class PasswordMd5 {

        public static String getMD5String(String str) throws NoSuchAlgorithmException {
            MessageDigest md=MessageDigest.getInstance("MD5");
            byte b[]=md.digest(str.getBytes());
            Formatter format=new Formatter();
            for(byte a:b) {
                format.format("%02x", a);
            }

            return format.toString();
        }



}
